<div class="row-fluid sortable ui-sortable">
<div class="box span12">
					<div class="box-header" data-original-title>
						<h2><i class="icon-user"></i><span class="break"></span><?php
                        $order = $this->order;
						echo $order["order_no"]." Created by ".$order["staff_name"]." On ".$order["order_create_date"];
						?>, Products Detail</h2>
						<div class="box-icon">
							<a href="#" class="btn-setting"><i class="icon-wrench"></i></a>
							<a href="#" class="btn-minimize"><i class="icon-chevron-up"></i></a>
							<a href="#" class="btn-close"><i class="icon-remove"></i></a>
						</div>
					</div>
					<div class="box-content">
                    <div>
                    Order Comment: <?php echo $order["order_comment"]?>
                    </div>
                    
<form action="" method="post"> 

<input id="id_order" name ="id_order"  type="hidden" value="<?=$order["id_order"]?>" >
<input id="order_no" name="order_no" type="hidden" value="<?=$order["order_no"]?>" >

<table class="table table-striped table-bordered bootstrap-datatable datatable ">

  <thead>
  <tr>
    <th scope="col"><input type="checkbox" name="check_all" id="check_all" />
      All</th>
    <th scope="col">Barcode</th>
    <th scope="col">Title</th>
    <th style="text-align:center" scope="col">Quantity</th>
    <th style="text-align:center" scope="col">Action</th>
  </tr>
  </thead>
 
  <tbody>
<?php
$products = new Model_DbTable_Productsva();
if(!empty($this->pList)){
 	foreach($this->pList as $v) {
		$productRow = $products->getProduct($v["id_product"]);
		?>  
 <tr>
 	<td><input type="checkbox" name="id_order_product[]" id="id_order_product<?=$v["id_order_product"]?>" value="<?=$v["id_order_product"]?>" /></td>
 	<td><?=$productRow["code_product"]?></td>
 	<td><?=$productRow["title_product"]?></td>
    <td><input style="width:50px" type="text" name="qty<?=$v["id_order_product"]?>" id="textfield<?=$v["id_order_product"]?>"  value="<?=$v["qty_order"]?>"/>
    	<input type="hidden" name = "id_product_list[]" id="id_product_list<?=$v["id_order_product"]?>" value="<?=$v["id_order_product"]?>">
    
    </td>
    <td>
 	  <button class="btn btn-small" data-rel="tooltip" title="" data-original-title="Hide Product">
 	    <i class="icon-trash"></i>
 	    </button>
 	  </td>        
 </tr> 
 <?php 
 	}
}?>
  </tbody>

</table>
<?php if($order["order_status"]<10){?>
<button  type="submit" class="btn btn-small btn-inverse" id="btn_add_product" name="btn_add_product" >Add Products</button>	 &nbsp;
<button  type="submit" class="btn btn-small btn-inverse" id="btn_remove_product" name="btn_remove_product" >Remove Selected</button>	 &nbsp;
<button  type="submit" class="btn btn-small btn-inverse" id="btn_save_change" name="btn_save_change" >Save Changes</button>	 &nbsp;
<?php } ?>
<button  type="submit" class="btn btn-small btn-warning" id="btn_cancel_order" name="btn_cancel_order" >Cancel Order</button>&nbsp;
<button  type="submit" class="btn btn-small btn-info" id="btn_final_order"  name ="btn_final_order"  >Finallize Order </button> &nbsp;


           				<div class="modal hide fade" id="modal_remove_product">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal">x</button>
				<h3>Remove Product</h3>
			</div>
			<div class="modal-body">
				<p>Confirm remove selected products Products</p>
			</div>
			<div class="modal-footer">
				<a href="#" class="btn" data-dismiss="modal">Close</a>
                
				<button class="btn btn-primary" type="submit" name="btn_confrim_remove" onClick="submitRemove()" >Confirm</button>
			</div>
		</div> 
           				<div class="modal hide fade" id="modal_save_change">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal">x</button>
				<h3>Save Changes</h3>
			</div>
			<div class="modal-body">
				<p>Double check all changes you have made before save it</p>
                
                <div class="alert alert-block ">
							<button data-dismiss="alert" class="close" type="button">×</button>
							<h4 class="alert-heading">Warning!</h4>
							<p>Only Changes on the Visible Rows will be Saved.</p>
						</div>
                
			</div>
			<div class="modal-footer">
				<a href="#" class="btn" data-dismiss="modal">Close</a>
				<button class="btn btn-primary" type="submit" name="btn_confrim_remove" onClick="submitSavechange()" >Save Change</button>
			</div>
		</div> 
           				<div class="modal hide fade" id="modal_cancel_order">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal">x</button>
				<h3>Cancel Order</h3>
			</div>
			<div class="modal-body">
				<div class="alert alert-error">
							<button data-dismiss="alert" class="close" type="button">×</button>
							<strong>Attention!</strong> You will not be able to re-active the Order once Canceled, only do when typing error.
						</div>
			</div>
			<div class="modal-footer">
				<a href="#" class="btn" data-dismiss="modal">Close</a>
				<button class="btn btn-primary" type="submit" name="btn_confrim_remove" onClick="submitCancel()" >Confirm Cancel Order</button>
			</div>
		</div> 
        
           			    <div class="modal hide fade" id="modal_final_order">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal">x</button>
				<h3>Finalized Order </h3>
			</div>
			<div class="modal-body">
				<p>You will Not be able to modify the order Again if you lock it</p>
			</div>
			<div class="modal-footer">
				<a href="#" class="btn" data-dismiss="modal">Close</a>
				<button class="btn btn-primary" type="submit" name="btn_confrim_remove" onClick="submitLock()" >Confirm Cancel Order</button>
			</div>
		</div> 


</form>	

            		</div>
                    </div>
                    </div>